package main

import (
	"gitee.com/ameise84/ppg_protobuf/generator"
	"google.golang.org/protobuf/types/pluginpb"
	"strconv"
	"strings"
)

func main() {
	g := generator.New()
	err := g.Run(transform)
	if err != nil {
		return
	}

}
func transform(g *generator.Generator) {
	file := pluginpb.CodeGeneratorResponse_File{}
	str := strings.Builder{}
	for _, b := range g.Buf.Bytes() {
		str.WriteString(strconv.Itoa(int(b)) + ",")
	}
	nstr := str.String()
	name := "client.log"
	file.Name = &name
	file.Content = &nstr
	g.Rsp.File = append(g.Rsp.File, &file)
}
